﻿namespace EFS.RC.CC.Messages.Communicator.Lync.Conversation
{
	/// Used for the statuses message list
	public class Info : EFS.RC.CC.Messages.Message
	{
		/// Monitoring status
		public enum MonitoringStatus
		{
			None,
			SupervisorListening,
			SupervisorWhispering,
			SupervisorBargedIn
		}

		/// Public constructor (used especially for deserialization)
		public Info() : base()
		{
			Clear();
		}

		/// Clear
		private void Clear()
		{
			Length = 0;
			IsMusicOn = false;
			IsOnHold = false;
			IsDialOut = false;
			Monitoring = MonitoringStatus.None;
		}

		/// RecorderPauseLength Length: Get, Set
		public System.Int64? RecorderPauseLength;

		/// Property Length: Get, Set
		public System.Int64 Length;

		/// Property Is music On: Get, Set
		public System.Boolean IsMusicOn;

		/// Property Is On Hold: Get, Set
		public System.Boolean IsOnHold;

		/// Property IsDialOut: Get, Set
		public System.Boolean IsDialOut;

		/// Property Guid: Get, Set
		public System.Guid Guid;

		/// Monitoring
		public MonitoringStatus Monitoring;

		/// Hunt Group Sip
		public System.String HuntGroupSip; 

		/// Serialize
		public override void Serialize(EFS.Common.Serialization.XmlWriter xmlWriter)
		{
			// write
			xmlWriter.Write("Length", Length);
			xmlWriter.Write("IsMusicOn", IsMusicOn);
			xmlWriter.Write("IsOnHold", IsOnHold);
			xmlWriter.Write("IsDialOut", IsDialOut);
			xmlWriter.Write("Guid", Guid);
			xmlWriter.Write("HuntGroupSip", HuntGroupSip);
			xmlWriter.Write("Monitoring", (System.Int32)Monitoring);
			xmlWriter.Write("RecorderPauseLength", RecorderPauseLength);
		}

		/// Deserialize
		public override void Deserialize(EFS.Common.Serialization.XmlReader xmlReader)
		{
			// read
			xmlReader.Read("Length", ref  Length);
			xmlReader.Read("IsMusicOn", ref  IsMusicOn);
			xmlReader.Read("IsOnHold", ref  IsOnHold);
			xmlReader.Read("IsDialOut", ref  IsDialOut);
			xmlReader.Read("Guid", ref  Guid);
			xmlReader.Read("HuntGroupSip", ref HuntGroupSip);
			Monitoring = (MonitoringStatus)xmlReader.ReadInt32("Monitoring");
			RecorderPauseLength = xmlReader.ReadInt32("RecorderPauseLength");
		}
	}

}